#include "game.h"

#include "board.h"

struct tetris_game
{
  HWND    wnd;
  void*   board;
};

void* init_game(HWND wnd)
{
  struct tetris_game* game = (struct tetris_game*)malloc(sizeof(*game));
  game->wnd = wnd;
  game->board = create_board(wnd);
  return (game);
}

void key_event(void* game, char key)
{
  struct tetris_game* g = (struct tetris_game*)game;
  board_check_key(g->board, key);
}

void game_loop(void* game)
{
  struct tetris_game* g = (struct tetris_game*)game;
  update_board(g->board);
}
